package com.zdp.demo.auth;

import cn.dev33.satoken.exception.SaTokenException;
import com.zdp.entity.base.R;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.RestControllerAdvice;

@RestControllerAdvice
public class SaTokenExceptionHandler {

    @ExceptionHandler(SaTokenException.class)
    public R handlerException(SaTokenException e) {
        e.printStackTrace();
        return R.fail(e.getMessage());
    }
}
